﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using OpenTKLightingTool.Data;

namespace OpenTKLightingTool.Controls
{
    /// <summary>
    /// Interaction logic for MaterialProperties.xaml
    /// </summary>
    public partial class MaterialProperties : UserControl
    {
        public MaterialProperties()
        {
            InitializeComponent();
        }

        /// <summary>
        /// Sets the material to UX
        /// </summary>
        internal void SetMaterial(Material mat)
        {
            uxAmbient.Value = mat.Ambient;
            uxDiffuse.Value = mat.Diffuse;
            uxSpecular.Value = mat.Specular;
            uxShineness.Value = mat.Shininess;
            uxEmissive.Value = mat.Emissive;
        }

        /// <summary>
        /// Gets the material from UX
        /// </summary>
        internal Material GetMaterial()
        {
            Material mat = new Material();
            mat.Ambient = uxAmbient.Value;
            mat.Diffuse = uxDiffuse.Value;
            mat.Specular = uxSpecular.Value;
            mat.Shininess = uxShineness.Value;
            mat.Emissive = uxEmissive.Value;
            return mat;
        }
    }
}
